package cn.xiaopengstack.domain.activity.model.valobj;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.stream.Stream;

/**
 * @author jiangyangang
 */
@Getter
@AllArgsConstructor
public enum GroupBuyActivityStatusEnum {
    CREATE(0, "创建"),
    EFFECT(1, "生效"),
    EXPIRED(2, "过期"),
    DELETED(3, "废弃"),
    ;

    private final Integer status;

    private final String info;

    public static GroupBuyActivityStatusEnum of(int status) {
        return Stream.of(GroupBuyActivityStatusEnum.values()).filter(s -> s.getStatus().equals(status)).findAny().get();
    }
}
